package com.itheima.service.impl;

import com.itheima.dao.BookDao;
import com.itheima.service.BookService;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

/**
 * @author: dh
 * @date: 2023-10-22 11:09
 */
public class BookServiceImpl implements BookService, InitializingBean, DisposableBean {

    // 声明数据层接口.
    private BookDao bookDao;

    @Override
    public void save() {

        System.out.println("book service save ...");
    }

    // 添加它的setter方法.
    public void setBookDao(BookDao bookDao) {

        this.bookDao = bookDao;
    }

    @Override
    public void destroy() throws Exception {

        System.out.println("service destroy");
    }

    @Override
    public void afterPropertiesSet() throws Exception {

        System.out.println("service init");
    }
}
